<!DOCTYPE html>
<script type="text/javascript">
	function jsonExecutesFirst() {

		this.sampleJson2 = function() {
			alert(true);
		}
		this.sampleJson = {
			'abc':jsonExecutesFirst.staticVar++,
			print: function() {
				jsonExecutesFirst.staticVar++;
			}
		};

		var privateMethod= function() {
			jsonExecutesFirst.staticVar++;
		}
		this.privateMethodCall=jsonExecutesFirst.staticVar++;

		this.privateVar=privateMethod;

		window.onload = function() {
			alert('Finally window.onload-->'+jsonExecutesFirst.staticVar);
		}
	}

	jsonExecutesFirst.staticVar=0;

	var jsonExecutesFirst1 = new jsonExecutesFirst();
	alert('jsonExecutesFirst.staticVar-->'+jsonExecutesFirst.staticVar);
	var jsonExecutesFirst2 = new jsonExecutesFirst();
</script>
===============================================================================================

<!DOCTYPE XHTML>
<script type="text/javascript">
	function NavDot(isSelected) {
		NavDot.insideCount=0;
		NavDot.insideCount++;
		NavDot.outsideCount++;
	}

	NavDot.outsideCount=0;
	new NavDot();
	alert(NavDot.insideCount+'outsideCount-->'+NavDot.outsideCount);
	new NavDot();
	alert(NavDot.insideCount+'outsideCount-->'+NavDot.outsideCount);
</script>
